// ./src/components/Users/UserSearch.jsx
import React, { Component, PropTypes } from 'react';
import {
  Form,
  Row,
  Col,
  Modal,
  Input,
  Radio,
  TreeSelect,
  Card,
  Button,
  Select
} from 'antd';
const FormItem =Form.Item;
import styles from './UserSearch.css';
const UserSearch = (  {userSelect,form: {
    getFieldDecorator,
    validateFields,
    getFieldsValue,
    resetFields
  }})=>{
function onSearch(currentItem) {
    validateFields((errors) => {
      if (errors) {
        return;
      }
      const name = getFieldsValue().name;
      const sex = getFieldsValue().sex;
      const phone = getFieldsValue().phone;
      const date={
        name,
        sex,
        phone


      }
      console.log('##################'+name+'#################');
      userSelect(date);


    });
  };



return(

<div  className={styles.searchDiv} >

        <Row gutter={16}>
          <Col span={3}>
          {getFieldDecorator('name', { })(<Input addonBefore='用户' className={styles.searchInput} type="text"/>)}

          </Col>
          <Col span={3}>
          {getFieldDecorator('sex', { })(<Input addonBefore='性别' className={styles.searchInput} type="text"/>)}

          </Col>
          <Col span={3}>
          {getFieldDecorator('phone', { })(<Input addonBefore='联系方式' className={styles.searchInput} type="text"/>)}

          </Col>
          <Col span={3}>
          <Button onClick={() => onSearch()} >搜索</Button>

          </Col>
        </Row>




   </div>

);

};
export default Form.create()(UserSearch);
